<template>
  <div>
    <div class="nav-left-bar">
      <ul>
        <li>
          <ul class="left-ul">
            <label><i class="el-icon-chat-line-round"></i>讨论区</label>
            <a href="" ><li>交流讨论</li></a>
            <a href=""><li>java</li></a>
            <a href=""><li>数据库</li></a>
            <a href=""><li>C语言</li></a>
            <a href=""><li>C#</li></a>
          </ul>
        </li>
        <li style="margin-top: 14px; padding-bottom: 14px; border-bottom: 1px solid #f3f3f9;">
          <ul class="left-ul">
            <label><i class="el-icon-chat-line-round" ></i>圈子</label>
            <a href=""><li>热议圈子</li></a>
          </ul>
        </li>
        <li>
          <ul class="left-ul">
            <label><i class="el-icon-chat-line-round"></i>我的圈子</label>
            <a href=""><li>我的圈子</li></a>
          </ul>
        </li>
      </ul>
    </div>
    <div class="mini-banner">
      <a href=""><img src="../../assets/hea.jpg"></a>
    </div>

    <div class="index-common">
    <div class="module-head">
      <div class="square"></div>
      <h6 style="display: inline-block;font-weight: bold;margin-top: 18px">分享与求助</h6>
        <div class="button-bar">
        <a href=""><i class="el-icon-edit" style="color: white">我要发布</i></a>
        </div>
    </div>
      <div class="green"></div>
    </div>
    <div class="discuss-tab-wrap">
        <a href="" class="discuss-tab" v-for="(item,index) in titles"
                    :class="{selected: currentIndex===index}" @click="titleClick(index)"
        >{{item}}</a>

    </div>
      <div class="menu-bar">
          <div class="menu-txt-box">
              <ul>
                  <li><a href="" class="">最新回复</a></li>
                  <li class="menu-pipe">|</li>
                  <li><a href="">最新发表</a></li>
                  <li class="menu-pipe">|</li>
                  <li><a href="">最热</a></li>
                  <li class="menu-pipe">|</li>
                  <li><a href="">精华</a></li>
              </ul>
          </div>
      </div>
      <div class="module-body" v-for="(item,index) in acticeData" :key="index">
          <ul>
              <li class="clearfix"><a class="head-pic" href=""><img src="../../assets/p.png" style="width: 100%" ></a>
                  <div class="discuss-detail">
                      <div class="discuss-main clearfix">
                          <router-link :to="{path: '/actice/'+item.id}">
                      <a href="" target="_blank" style="text-decoration: none;font-weight: bold">
                          {{item.title}}
                          <span>置顶</span>
                          <span>烫</span>
                      </a>
                          </router-link>
                      </div>
                  <a href=""></a>
                  <div class="feed-foot">
                      <a href="" target="_blank"></a>
                        <div class="feet-origin">
                            <p class="feed-tip">
                                <a href=""></a>
                                <a href="" style="color: red;text-decoration: none">{{item.writer}}</a>
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                {{item.createTime}} &nbsp;&nbsp;
                                发表在
                                <a href="" style="font-size: 12px">[站内公告]</a>
                                &nbsp;&nbsp;3天前回复
                            </p>
                        </div>
                        <div class="feed-legend">
                            <span>回复
                                <span>{{item.commentCount}}</span>
                            </span>
                            <span class="feed-legend-pipe">|</span>
                            <span>赞
                                <span>{{item.zan}}</span>
                            </span>
                            <span class="feed-legend-pipe">|</span>
                            <span>浏览
                                <span>{{item.viewCount}}</span>
                            </span>
                        </div>
                  </div>
                  </div>
              </li>
          </ul>
      </div>
      <div style="display: flex;justify-content: center;margin-top: 10px">
          <el-pagination
                  background
                  @size-change="sizeChange"
                  @current-change="currentChange"
                  :current-page="currentPage"
                  :page-size="pageSize"
                  layout="sizes, prev, pager, next, jumper, ->, total, slot"
                  :total="total">
          </el-pagination>
      </div>
      <div class="right-m">
          <div class="imgright">
              <a href="" target="_blank"><img src=""></a>
          </div>
          <div>
              <div class="square" style="margin-left: 20px"></div>
              <h6 style="font-weight: bold;margin-left: 40px;margin-top: -20px">实时热点</h6>
          </div>
          <div class="flex-menu">
            <ul>
                <li>
                    <div class="right-mottom"><div class="yuan" style="position: relative;top: 12px;left: -8px"></div><a><span># </span><span>中信毁约</span><span> #</span></a></div>
                    <div><span class="sty">6382次浏览</span><span class="sty">2282人参与</span></div>
                </li>
                <li>
                    <div class="right-mottom"><div class="yuan" style="position: relative;top: 12px;left: -8px"></div><a><span># </span><span>中信毁约</span><span> #</span></a></div>
                    <div><span class="sty">6382次浏览</span><span class="sty">2282人参与</span></div>
                </li>
                <li>
                    <div class="right-mottom"><div class="yuan" style="position: relative;top: 12px;left: -8px"></div><a><span># </span><span>中信毁约</span><span> #</span></a></div>
                    <div><span class="sty">6382次浏览</span><span class="sty">2282人参与</span></div>
                </li>
                <li>
                    <div class="right-mottom"><div class="yuan" style="position: relative;top: 12px;left: -8px"></div><a><span># </span><span>中信毁约</span><span> #</span></a></div>
                    <div><span class="sty">6382次浏览</span><span class="sty">2282人参与</span></div>
                </li>
            </ul>
          </div>
      </div>
  </div>
</template>
<style scoped>
    .right-mottom a :hover{
        color: #25BB9B;
    }
    .flex-menu ul li{
        margin-top: 20px;
    }
    .yuan{
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background-color: black;
    }
    .sty{
        margin-left: 8px;
        font-size: 12px;
        color: #999999;
    }
    .right-mottom{
        margin-left: 5px;
        font-size: 14px;
    }
    .right-m{
        margin-top: -320px;
        background-color: white;
        margin-left: 76%;
        width: 20%;
    }

    .feed-foot{
        font-size: 12px;
    }

    .feed-legend-pipe {
        padding: 0 5px;
    }
    .feed-foot {
        color: #999;
        margin-top: 5px;
        white-space: nowrap;
    }

    .feed-legend {
        float: right;
        color: #999;
    }
    .discuss-main a:hover{
        color: #25BB9B;
    }

    .menu-txt .selected a {
        color: #25bb9b;
    }
    .head-pic {
        border-radius: 50%;
        display: block;
        float: left;
        margin-right: 10px;
        overflow: hidden;
        width: 50px;
        height: 50px;
    }
    .module-body{
        margin-left: 20%;
        padding: 20px;
        background-color: white;
        width: 55%;
    }
    .menu-pipe {
        color: #eee;
        vertical-align: 1px;
    }
    .menu-txt a {
        padding: 0 10px;
        color: #888;
    }
    .menu-bar{
        width: 55%;
        background-color: white;
        margin-left: 20%;
    }
    .menu-txt-box ul li{
        display: inline-block;
        margin-right: 1px;
    }
    .menu-txt-box {
        padding: 10px;
        font-size: 14px;
    }
  label a li{
    text-decoration: none;
  }
  .menu-txt-box a:hover{
      color: #25bb9b;
      text-decoration: none;
  }
  .discuss-tab-wrap a:hover{
      color: #25bb9b;
  }
  .discuss-tab-wrap a{
    color: #333333;
    text-decoration: none;
  }
  .discuss-tab.selected{
    background: #25bb9b;
    color: #fff!important;
    text-align: center;
  }
  .discuss-tab {
    padding: 0 5px;
    height: 28px;
    line-height: 28px;
    display: inline-block;
    white-space: nowrap;
    font-size: 14px;
    margin-right: 10px;
    margin: 0 10px 5px 0;
  }
  .discuss-tab-wrap {
    width: 55%;
    background: #f5f5f5;
    padding: 15px 15px 10px;
    margin-left: 20%;
  }
  .green{
    margin-top:43px ;
    width: 100%;
    height: 3px;
    background-color: #25bb9b;
  }

  .module-head{
    margin-left: 18px;
    line-height: 7px;
  }
  .square{
    margin-right: 7px;
    width: 7px;
    height: 7px;
    background-color: red;
    display: inline-block;
  }

  .button-bar{
    background-color:#25BB9B;
    display: inline-block;
    margin-left: 70% ;
    text-align: center;
    padding: 10px 0;
    width: 110px;
    color: #fff;
    font-size: 14px;
    border-radius: 3px;
    border: none 0;
    cursor: pointer;
    line-height: normal;
    outline: 0;
    white-space: nowrap;
  }

  .index-common{
    margin-top: 1%;
    margin-left: 20%;
    width: 55%;
    height: 95px;
    background-color: white;
  }

  a li{
    width: 90%;
    height: 30px;
    line-height: 30px;
    text-indent: 2em;

  }
  .left-ul a{
      text-decoration: none;
  }
  .left-ul a li:hover{
    color: #26C8D2;
    background-color: #E9F8F5;
  }
  li{
    margin-top: 8px;
    margin-left: 8px;
  }
  ul label{
    color: #333333;
    font-size: 16px;
    font-weight: bold;
  }
  a{
    text-decoration: none;
    font-size: 14px;
    color: #666;
  }
  body{
    background-color: #F7F8F9;
    margin: 0px;
    padding: 0px;
    font: 12px/1.5 system,-apple-system,BlinkMacSystemFont,"Helvetica Neue",Helvetica,"PingFang SC","Segoe UI","Microsoft YaHei","wenquanyi micro hei","Hiragino Sans GB","Hiragino Sans GB W3",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans",Arial,sans-serif;
  }
  .mini-banner img {
    margin-top: -20px;
    display: block;
    height: 70px;
    width: 80%;
    margin-left: 20%;
  }
  .nav-left-bar {
    margin-left: 50px;
    width: 180px;
    position: fixed;
    top: 80px;
    bottom: 0;
    border-radius: 2px;
    background: #fff;
    padding: 20px 10px;
    z-index: 3;
    overflow-y: auto;
  }

  ul li{
    list-style: none;
  }
</style>
<script>
  import {getActiceList} from "../../api/blog/blog";

  export default {
    data() {
      return {
          acticeData:[],
          total:0,
          currentPage:1,
          size:10,
        rules: {
        },
        titles:['全部','站内公告','笔经面经','技术交流',' java ','数据库','C #','C语言','数据结构','疑难杂症','同学心得','职业发展','关于本站'],
          currentIndex:0
      }
    },
      created() {
        this.getActiceList()
      },
      methods: {
        getActiceList(){
            console.log("dd");
            const _this=this;
        getActiceList(this.currentPage,this.size).then(resp=>{
            console.log(resp.data.list);
            _this.acticeData=resp.data.list.list
        })
        },
        titleClick(index){
            this.currentIndex=index
        },

      sum1(){
         var _this=this
        this.$axios
        .post('/InsertMorning',{
          morning:_this.ruleForm.morning
        })
        .then(resp=>{
          alert(resp.data.message)
        })
      },
      sum3(){
        var _this=this
        this.$axios
            .post('InsertEvening',{
              evening:_this.ruleForm.evening,
              summary:_this.ruleForm.summary
            })
            .then(resp=>{
              alert(resp.data.message)
            })
      },
      sum2(){
        var _this=this
        this.$axios
            .post('',_this.ruleForm.morning)
            .then(resp=>{
              alert(resp.data.message)
            })
      }
    }
  }
</script>
